<script type="text/javascript">
    $(document).ready(function()
    {
        $("select, input").uniform();
    });
</script>
<?php
    function __autoload($class_name)
	{
		include_once('../classes/'.strtolower($class_name).'.php');
	}
    
    if(isset($_POST['MaLoaiSanPham']))
        $MaLoaiSanPham = $_POST['MaLoaiSanPham'];
    else
        $MaLoaiSanPham = 0;
        
    if(isset($_POST['MaLoaiSanPhamCap2']))
        $MaLoaiSanPhamCap2 = $_POST['MaLoaiSanPhamCap2'];
    else
        $MaLoaiSanPhamCap2 = 0;
        
    if(isset($_POST['MaLoaiSanPhamCap3']))
        $MaLoaiSanPhamCap3 = $_POST['MaLoaiSanPhamCap3'];
    else
        $MaLoaiSanPhamCap3 = 0;
        
    $MaLoaiSanPhamCap1 = 0;
    
    $loaisanphamc1 = new loaisanphamc1bs();
    $ret_loaisanphamc1 = $loaisanphamc1->getList();
    
    $loaisanphamc1->MaLoaiSanPham = $MaLoaiSanPham;
    $loaisanphamc1->MaLoaiSanPhamCap2 = $MaLoaiSanPhamCap2;
    $loaisanphamc1->MaLoaiSanPhamCap3 = $MaLoaiSanPhamCap3;
    
    $ret_loaisanphamc1_id = $loaisanphamc1->getIds();
    $MaLoaiSanPhamCap1 = $ret_loaisanphamc1_id[0]['MaLoaiSanPhamCap1'];
    
	echo '<select name="MaLoaiSanPhamCap1" id="MaLoaiSanPhamCap1" onchange="onchangeStyleProductFir();">';
	for($i = 0; $i < ($ret_loaisanphamc1 != false ? count($ret_loaisanphamc1) : 0); $i++)
	{
        $selected = '';
        if($ret_loaisanphamc1[$i]['MaLoaiSanPhamCap1'] == $MaLoaiSanPhamCap1)
            $selected = "selected = selected";
		echo "<option {$selected} value=\"{$ret_loaisanphamc1[$i]['MaLoaiSanPhamCap1']}\">{$ret_loaisanphamc1[$i]['TenLoaiSanPhamCap1']}</option>";
	}
    echo '</select>';
?>